package com.untrance.shop.core.builder.vo;

import com.untrance.shop.common.vo.CategoryVO;
import com.untrance.shop.model.Category;

/**
 * @author eugene zadyra
 */
public class CategoryVOBuilder extends AbstractVOBuilder<Category, CategoryVO> {

	@Override
	protected CategoryVO transform(Category category) {
		CategoryVO vo = new CategoryVO();
		if (category.getChildren() != null) {
			vo.setChildren(createVOList(category.getChildren()));
		}
		vo.setName(category.getName());
		return vo;
	}

}
